package com.amqr.testfragment.fragment.style1;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

import com.amqr.testfragment.GeneralConst;
import com.amqr.testfragment.R;

/**
 * User: LJM
 * Date&Time: 2016-11-23 & 21:04
 * Describe: Describe Text
 */
public class TwoFragment extends Fragment {
    private View rootView;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        Log.d(GeneralConst.TAG,"TwoFragment --- onCreateView");
        rootView = View.inflate(getActivity(), R.layout.fragment_two, null);
        initView();
        return rootView;
    }
    private void initView() {
        rootView.findViewById(R.id.mTvOne).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(getActivity(),"TwoFragment的Tv点击",Toast.LENGTH_SHORT).show();
            }
        });
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        Log.d(GeneralConst.TAG,"TwoFragment --- onAttach");
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d(GeneralConst.TAG,"TwoFragment --- onCreate");
    }

    @Override
    public void onStart() {
        super.onStart();
        Log.d(GeneralConst.TAG,"TwoFragment --- onStart");
    }

    @Override
    public void onResume() {
        super.onResume();
        Log.d(GeneralConst.TAG,"TwoFragment --- onResume");
    }

    @Override
    public void onPause() {
        super.onPause();
        Log.d(GeneralConst.TAG,"TwoFragment --- onPause");
    }

    @Override
    public void onStop() {
        super.onStop();
        Log.d(GeneralConst.TAG,"TwoFragment --- onStop");
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        Log.d(GeneralConst.TAG,"TwoFragment --- onDestroyView");
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.d(GeneralConst.TAG,"TwoFragment --- onDestroy");
    }

    @Override
    public void onDetach() {
        super.onDetach();
        Log.d(GeneralConst.TAG,"TwoFragment --- onDetach");
    }
}
